import cgi

from google.appengine.ext import db

from gaeo.controller import BaseController

from model.imgs import Imgs

class ImgsController(BaseController):
    def create(self):
        r = Imgs(
            # Uncomment all required properties here.
            # comment = self.params.get('comment', None),
            # pict = self.params.get('pict', None),
            # top = self.params.get('top', None),
            # height = self.params.get('height', None),
            # post_date = self.params.get('post_date', None),
            # width = self.params.get('width', None),
            # rate = self.params.get('rate', None),
            # user = self.params.get('user', None),
            # mod_date = self.params.get('mod_date', None),
            # tag_list = self.params.get('tag_list', None),
            # left = self.params.get('left', None),
        )
        for prop in Imgs.properties():
            if prop in self.params:
                setattr(r, prop, self.params.get(prop))
        r.put()
        self.redirect('/imgs')

    def index(self):
        query = Imgs.all()
        self.result = query.fetch(limit=1000)

    def new(self):
        pass
